package com.yishun.springboot.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.yishun.springboot.pojo.YzwWorkerAttendanceListNew;
import com.yishun.springboot.pojo.YzwWorkerList;

/**
 * 云筑网保存信息mapper(本mapper经更新后不更改只添加，见以下新增方法字样)
 * 
 * @author YS
 *
 */
@Component
public interface YzwWorkerListMapper {

	YzwWorkerList findOneRecordByIdCardNumber(@Param(value = "idCardNumber") String idCardNumber,
			@Param(value = "projectCode") String projectCode);

	int updateWorkListByIdCardNumber(@Param(value = "exitTime") String exitTime,
			@Param(value = "idCardNumber") String idCardNumber);

	// 2021.3.15 根据idCardNumber 查找退场时间
	String seletExitTimeByIDCardNumber(String idCardNumber);

	// 新增 2021.3.9 增加
	int insertOneRecord(YzwWorkerList yzwWorkerList);

	// 新增 2021.3.8 根据项目号和姓名查找
	YzwWorkerList findWorkerRecord(@Param(value = "ProjectSysNo") int ProjectSysNo,
			@Param(value = "WorkerName") String WorkerName);

	int updateStatus(String IDCardNumber);

	// 修改 2021.3.5 根据项目号和工种号查询工人/管理列表
	List<YzwWorkerList> findMultipleRecordByProjectSysNo(@Param(value = "ProjectSysNo") Integer ProjectSysNo,
			@Param(value = "ExitTime") Boolean ExitTime);

	List<YzwWorkerList> findAll();

	int deleteAllYzwworkerlist();

	int insertAllYzwworkerlist(List<YzwWorkerList> yzwWorkerList);

	/**
	 * 获取云筑网考勤模块的人员花名册
	 * 
	 * @param pageSize
	 * @param projectCode
	 * @return
	 */
	List<Map<String, Object>> getRoster(@Param(value = "pageSize") Object pageSize,
			@Param(value = "projectCode") String projectCode);

	// 为下方接口调用前的准备
	List<YzwWorkerAttendanceListNew> findWorkerSysNo();

	int findCount(String Device_code);

	/**
	 * 考勤数据列表插入
	 * 
	 * @return
	 */
	int insertAllYzwWorkerAttendanceListNew(List<YzwWorkerAttendanceListNew> yzwWorkerAttendanceListNew);

	List<YzwWorkerList> selectByProjectCode(int ProjectSysNo);

}